<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SearchAward.ascx.vb"
    Inherits="WebForm_ManageAward_SearchAward" %>
<%@ Register Src="~/WebForm/CommonControl/AnnualControl.ascx" TagName="AnnualControl"
    TagPrefix="My" %>    
<table>
    <tr>
        <td>
            <table>
                <tr>
                    <td align="right">
                        <asp:Label ID="lblAnnual" runat="server" meta:resourcekey="lblAnnual"></asp:Label>
                    </td>
                    <td align="left">
                        <My:AnnualControl ID="txtAnnual" runat="server" />
                        <%--                        <asp:TextBox ID="txtAnnual" runat="server" meta:resourcekey="txtAnnual" 
                            MaxLength="5"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="rfvAnnual" runat="server" Display="None" 
                        ControlToValidate="txtAnnual" meta:resourcekey="rfvAnnual" 
                        ValidationGroup="Query" ValidationExpression="[0-9]{4}"></asp:RegularExpressionValidator>--%>
                    </td>
                    <td>
                        <%--<asp:Label ID="lblAnnualhint" runat="server" meta:resourcekey="lblAnnualhint"></asp:Label>--%>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <asp:Label ID="lblAwardName" runat="server" meta:resourcekey="lblAwardName"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtAwardName" runat="server" meta:resourcekey="txtAwardName" MaxLength="50"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Button ID="btnQuery" runat="server" meta:resourcekey="btnQuery" ValidationGroup="Query" />
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<br />
<My:MyGridView ID="GV" runat="server" AllowHoverEffect="False" AllowHoverSelect="False"
    AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="AwardID"
    EmptyDataText="<%$ Resources:EmptyData %>" MySortDirection="Ascending" SkinID="pager"
    DataSourceID="ObjectDataSource1">
    <Columns>
        <asp:BoundField DataField="AwardName" meta:resourcekey="bfAwardName" />
        <%--<asp:BoundField DataField="Annual" meta:resourcekey="bfAnnual" />--%>
        <asp:TemplateField meta:resourcekey="bfAnnual">
            <itemtemplate>
                <%#New Date(Eval("Annual"), 1, 1).ToString("yyyy")%>
            </itemtemplate>
        </asp:TemplateField>        
        <asp:BoundField DataField="Description" meta:resourcekey="bfDescription" />
        <asp:TemplateField>
            <itemtemplate>
                <asp:LinkButton ID="lbtnEdit" runat="server" CommandName="Select" 
                    Text="<%$ Resources:Edit %>"></asp:LinkButton>
            </itemtemplate>
            <itemstyle horizontalalign="Center" />
        </asp:TemplateField>
        <asp:TemplateField ShowHeader="False">
            <itemtemplate>
                <asp:LinkButton ID="lbtnDelete" runat="server" CausesValidation="False" 
                    CommandName="Delete" onclick="lbtnDelete_Click" 
                    OnClientClick="<%$ Resources:DeleteConfirm %>" Text="<%$ Resources:Delete %>"></asp:LinkButton>
            </itemtemplate>
            <itemstyle horizontalalign="Center" />
        </asp:TemplateField>
    </Columns>
</My:MyGridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="BLL_Delete"
    OldValuesParameterFormatString="original_{0}" SelectMethod="BLL_Select" TypeName="BLL_SearchAward">
    <DeleteParameters>
        <asp:Parameter Name="original_AwardID" Type="Int32" />
    </DeleteParameters>
    <SelectParameters>
        <asp:Parameter Name="AwardName" Type="String" />
        <asp:Parameter Name="Annual" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
<asp:ValidationSummary ID="sum_Query" runat="server" DisplayMode="List" ShowMessageBox="True"
    ShowSummary="False" ValidationGroup="Query" />
